function [data] = gendatafornwsgrp(param)


enlabelfile = strcat(pwd,'/newsgroup/nwsgrpmbase',num2str(param),'.mat');
ensm = load(enlabelfile);
ensm = ensm.A;

trlabelfile = strcat(pwd,'/newsgroup/nwsgrplabel',num2str(param),'.mat');
labels      = load(trlabelfile);
labels      = labels.A;

N = size(labels,1);

for i=1:2

    T     = ensm(:,i);
    Clsno = size(unique(T),1); 
    temp  = zeros(N,Clsno);
    temp  = temp';
    temp2 = T+Clsno*[0:N-1]';
    temp(temp2)=1;
    dataw1(i).w = temp';
    
end

data.K1 = Clsno;

for j=1:2
    
    T     = ensm(:,i+j);
    Clsno = size(unique(T),1)
    temp  = zeros(N,Clsno);
    temp  = temp';
    temp2 = T+Clsno*[0:N-1]';
    temp(temp2)=1;
    dataw2(j).w = temp';
    
end

data.K2 = Clsno;

data.dataw1    = dataw1;
data.dataw2    = dataw2;
data.truelabel = labels;
data.r1        = max(size(dataw1));
data.r2        = max(size(dataw2));

end
